export const getLocal = (attr) => {
  return window.localStorage.getItem(attr) || ''
}

export const setLocal = (attr, value) => {
  try {
    window.localStorage.setItem(attr, value)
  } catch (error) {
    console.log('设置失败')
  }
}

// 获取session
export const getSession = (attr) => {
	return window.sessionStorage.getItem(attr) || ''
}

// 设置session
export const setSession = (attr, value) => {
	try {
	  window.sessionStorage.setItem(attr, value)
	} catch (error) {
	  console.log('设置失败')
	}
  }